﻿using System.Collections;
using System.Collections.Generic;
using System.Net.Sockets;
using System.Threading;
using UnityEngine;
namespace EzFrameWork
{
	public class EzTCPUser
	{
		public Socket socket;
		public Thread thread;
		public EzTCPUser()
		{
        
		}

		public EzTCPUser(Socket socket, Thread thread)
		{
			this.socket = socket;
			this.thread = thread;
		}

		/// <summary>
		/// 获取Socket
		/// </summary>
		/// <returns></returns>
		public Socket GetSocket()
		{
			return socket;
		}

		/// <summary>
		/// 获取线程
		/// </summary>
		/// <returns></returns>
		public Thread GetThread()
		{
			return thread;
		}

		public void CloseLink()
		{
			if (socket!=null)
			{
				socket.Close();
			}
			if (thread!=null)
			{
				thread.Abort();
			}
		}
	}

}
